<template>
    <div class="follow">
        <ol>
            <li v-for="topic in topics" :key="topic.topicId" @click="problemList(topic.topicId)">
                {{topic.topicName}}
            </li>
        </ol>
    </div>
</template>

<script>
import {postRequest,getRequest} from '../utils/api.js'
export default {
    name: 'MyFollowTopic',

    data() {
        return {
            topics:[],
        };
    },

    mounted() {
        getRequest('/user/follow/searchFollowTopics').then((result) => {
            if(result){
                this.topics = result;
            }
        }).catch((err) => {
            
        });
    },

    methods: {
        problemList(id){
            this.$router.push({
                name:"problemList",
                query:{
                    id
                }
            })
        },
    },
};
</script>

<style  scoped>
.follow{
    display: inline-block;
    font-size: 22px;
}
.follow ol li{
    margin-bottom: 15px;
   cursor: pointer;
}
</style>